
PICS=


LATEX    = latex
BIBTEX   = bibtex
DVIPS    = dvips
FIG2DEV  = fig2dev
XSLTPROC = xsltproc

.SUFFIXES : .ltx .dvi .ps .fig .tex .eps .xml .html

%.dvi: %.tex
	$(LATEX) $<
	if grep Rerun `basename $< .tex`.log >/dev/null; then $(LATEX) $< ; fi
	$(BIBTEX) `basename $< .tex`
	$(LATEX) $<
	if grep Rerun `basename $< .tex`.log >/dev/null; then $(LATEX) $< ; fi

%.ps: %.dvi
	$(DVIPS) -f < $< > $@

%.tex: %.fig
	$(FIG2DEV) -L latex < $< > $@

%.eps: %.fig
	$(FIG2DEV) -L eps < $< > $@

%.html: %.xml
	$(XSLTPROC) xml2html.xsl $<

%.bib: %.xml
	$(XSLTPROC) xml2bib.xsl $< > $@


all: list.html lit.bib
	cp list.html index.html


list.html: lit.html
	cp list.html lit.html


clean:
	rm -f *.o *.a *~ *.dvi *.bak *.html core
	rm -f *.bib *.aux *.log *.toc *.bbl *.blg $(PICS)


paper.dvi: paper.tex $(PICS)

